<?php
$title='首页';
define('IN_TG', 'admin_index');
include('admin_header.php');
$sql = "select tg_id,tg_username,tg_sex,tg_reg_time,tg_last_time,tg_login_count from tg_user order by tg_reg_time desc limit 0,8";

$res = _query($sql);
?>
    <div class="row">
        <div class="col-lg-12">
            <h1>多用户留言 <small>后台管理系统</small></h1>
            <ol class="breadcrumb">
                    <li class="active"><i class="fa fa-home"></i> 首页</li>
            </ol>
        </div>
        <div class="col-lg-12">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-bar-chart-o"></i> 用户图表 <span id="user_info_time"></span></h3>
                </div>
                <div class="panel-body">
                    <div id="morris-chart-area"></div>
                </div>
            </div>
        </div>
    </div><!-- /.row -->

    <div class="row">
        <div class="col-lg-4">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-long-arrow-right"></i> 帖子图表 <span id="article_info_time"></span></h3>
                </div>
                <div class="panel-body">
                    <div id="morris-chart-donut"></div>
                    <div class="text-right">
                        <a href="admin_article.php">帖子管理<i class="fa fa-arrow-circle-right"></i></a>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-8">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-clock-o"></i> 新注册用户信息 </h3>
                </div>
                <div class="panel-body">
                    <div class="table-responsive" id="user_reg_list">
                        <table class="table table-bordered table-hover table-striped tablesorter">
                            <thead>
                            <tr>
                                <th class="header">用户 ID <i class="fa fa-sort"></i></th>
                                <th class="header">用户 用户名 <i class="fa fa-sort"></i></th>
                                <th class="header">用户 性别 <i class="fa fa-sort"></i></th>
                                <th class="header">用户 注册时间 <i class="fa fa-sort"></i></th>
                                <th class="header">用户 登录时间 <i class="fa fa-sort"></i></th>
                                <th class="header">用户 登录次数 <i class="fa fa-sort"></i></th>
                            </tr>
                            </thead>
                            <tbody>
                                <?php while($row = _fetch_array_list($res)): ?>
                                <tr>
                                    <td><?php echo $row['tg_id'];?></td>
                                    <td><?php echo $row['tg_username'];?></td>
                                    <td><?php echo $row['tg_sex'];?></td>
                                    <td><?php echo $row['tg_reg_time'];?></td>
                                    <td><?php echo $row['tg_last_time'];?></td>
                                    <td><?php echo $row['tg_login_count'];?></td>
                                </tr>
                                <?php endwhile;?>
                            </tbody>
                        </table>
                    </div>
                    <div class="text-right">
                        <a href="admin_user.php">用户管理<i class="fa fa-arrow-circle-right"></i></a>
                    </div>
                </div>
            </div>
        </div>
    </div><!-- /.row -->

    </div><!-- /#page-wrapper -->
</div><!-- /#wrapper -->
<?php
    include('admin_footer.php');
?>
<script>
    $("#admin_home").attr('class','active');
</script>
<!-- Page Specific Plugins -->
<script src="js/raphael-min.js"></script>
<script src="js/morris-0.4.3.min.js"></script>
<script src="js/morris/chart-data-morris.js"></script>